<?php
// +----------------------------------------------------------------------
// | 07FLYSAAS [基于ThinkPHP5.0开发]
// +----------------------------------------------------------------------
// | Copyright (c) 2025-2035 http://www.07fly.xyz
// +----------------------------------------------------------------------
// | Professional because of focus  Persevering because of happiness
// +----------------------------------------------------------------------
// | Author: 开发人生 <goodkfrs@qq.com>
// +----------------------------------------------------------------------

namespace app\plat\controller;

/**
 * 邮件管理
 */
class TenEmail extends PlatBase
{

    //配置
    public function config()
    {
        IS_POST && $this->jump($this->logicTenEmail->setTenEmailConf($this->param));
        $config = $this->logicTenEmail->getTenEmailConf($this->param);
        $param = $this->logicTenEmail->getEmailParam();
        $this->assign('param', $param);
        $this->assign('info', $config);
        return $this->fetch('config');
    }

    //发送邮件
    public function send()
    {
        IS_POST && $this->jump($this->logicTenEmail->sendTenEmail($this->param));
        $this->assign('info', $this->param);
        return $this->fetch('send');
    }

    /**
     * 列表模块
     */
    public function show()
    {
        return $this->fetch('show');
    }

    /**
     * 列表数据
     */
    public function show_json()
    {
        $where = $this->logicTenEmail->getWhere($this->param);
        $list = $this->logicTenEmail->getTenEmailLogList($where);
        return $list;
    }

    //删除
    public function del()
    {
        $this->jump($this->logicTenEmail->tenEmailLogDel($this->param));
    }
}
